package models

import (
	"go-admin/common/models"
)

type App struct {
	models.Model

	Name         string        `json:"name" gorm:"type:varchar(128);comment:流水线名称"`
	AppType      string        `json:"appType" gorm:"type:varchar(128);comment:app类型"`
	Port         string        `json:"port" gorm:"type:int"`
	Environments []Environment `json:"environments" gorm:"many2many:app_environment;"`
	CodeRepo     string        `json:"codeRepo" gorm:"type:varchar(128);comment:代码仓库地址"`
	Status       string        `json:"status" gorm:"type:int;comment:状态"`
	Remark       string        `json:"remark" gorm:"type:varchar(255);comment:备注"`
	models.ModelTime
	models.ControlBy
}

func (App) TableName() string {
	return "app"
}

func (e *App) Generate() models.ActiveRecord {
	o := *e
	return &o
}

func (e *App) GetId() interface{} {
	return e.Id
}
